	var popup;
	var info;
	var map;
	var geographic = new OpenLayers.Projection("EPSG:4326");
	var mercator = new OpenLayers.Projection("EPSG:900913");
	
	OpenLayers.ProxyHost = "geoproxy.php?url=";
function init(geoserver_base_url){
	var world = new OpenLayers.Bounds(-180, -89, 180, 89).transform(
		geographic, mercator
	);
	var custom_center = new OpenLayers.LonLat(105.85249278, 21.029505388).transform(
		geographic, mercator
	);

 
	var options = {
		//projection:geographic,// "EPSG:4326",
		//displayProjection: geographic,
		//units: 'degrees',		
		projection: mercator,
		displayProjection: geographic,			
		units: 'm',
		maxExtent: world,
 		//maxResolution: 0.0000388994812965, 
		numZoomLevels:21,
        allOverlays: true
	};

	map = new OpenLayers.Map("map",options);
	
 	var layGiaoThongDuongBo = new OpenLayers.Layer.WMS(
		"Giao thông đường bộ (roads)",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:roads", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: true
        }
	); 
	
	var layGiaoThongDuongSat = new OpenLayers.Layer.WMS(
		"Giao thông đường sắt (railways)",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:railways", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: true
        }
	);	
	
		
//	hanh chinh tinh
 	var layHanhChinhTinh	= new OpenLayers.Layer.WMS(
		"Hành chính tỉnh",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bando_diaphantinh", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: true
        }
	);		
	
//	hanh chinh huyen
 	var layHanhChinhHuyen	= new OpenLayers.Layer.WMS(
		"Hành chính Huyện",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bando_hc_huyenv1", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: true
        }
	);		
	
//	hanh chinh xa
 	var layHanhChinhXa	= new OpenLayers.Layer.WMS(
		"Lớp hành chính xã",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bando_hc_xav1", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);	

//	song suoi a
 	var lay_songsuoia	= new OpenLayers.Layer.WMS(
		"Sông suối",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bando_songsuoia", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);	
	
//	mat nuoc tinh
  	var lay_matnuoctinh	= new OpenLayers.Layer.WMS(
		"Mặt nước tĩnh",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bando_matnuoctinh", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);	
//	mat nuoc tinh
  	var lay_matnuoctinh500k	= new OpenLayers.Layer.WMS(
		"Mặt nước tĩnh 500k",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bando_matnuoctinh500k", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);	
	
//	lop nha
  	var lay_nhap	= new OpenLayers.Layer.WMS(
		"Nhà",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:dungtv_bando_ioc_nhap", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);		
	
	
//	Nhan tinh thÃ nh phá»‘
  	var lay_nhantinh	= new OpenLayers.Layer.WMS(
		"Nhãn tỉnh - thành phố",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bando_tentinh100k_point", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);
	
//	Nhan huyen
  	var lay_nhanhuyen	= new OpenLayers.Layer.WMS(
		"Nhãn Quận - Huyện",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bando_tenhuyen100k_point", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);	
	
//	UBND Tinh
  	var lay_ubnd_tinh	= new OpenLayers.Layer.WMS(
		"UBND Tỉnh",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bandonen_uybantinh", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);		
//	UBND Huyen
  	var lay_ubnd_huyen	= new OpenLayers.Layer.WMS(
		"UBND Huyện",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_bando_trusouybanhuyenp", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);		
	
//	NGUON LUC: DON VI HO TRO
  	var lay_nguonluc_dvihtro	= new OpenLayers.Layer.WMS(
		"Đơn vị hỗ trợ",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_nguonluc_dvihtro", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);	
	
//	NGUON LUC: PHUONG TIEN HO TRO
  	var lay_nguonluc_phuongtien	= new OpenLayers.Layer.WMS(
		"Phương tiện hỗ trợ",
		geoserver_base_url+"geoserver/cite/wms?",
		{
			layers: "cite:ioc_nguonluc_phuongtien", 
			transparent: true
		},
		{
			isBaseLayer: false,
			buffer: 0,
			visibility: false
        }
	);		

	map.addLayer(layHanhChinhTinh); 
	map.addLayer(lay_songsuoia);	
 	map.addLayer(lay_matnuoctinh); 		
	map.addLayer(lay_matnuoctinh500k);
	map.addLayer(lay_nhap);
  	map.addLayer(layGiaoThongDuongBo); 	
	map.addLayer(layHanhChinhHuyen);	
	map.addLayer(layHanhChinhXa);			
  	map.addLayer(layGiaoThongDuongSat); 	
 	map.addLayer(lay_nhantinh);			
  	map.addLayer(lay_nhanhuyen);
	map.addLayer(lay_ubnd_tinh);
	map.addLayer(lay_ubnd_huyen);
	//NGUON LUC
	map.addLayer(lay_nguonluc_dvihtro);
	map.addLayer(lay_nguonluc_phuongtien);	
	
	map.setCenter(custom_center, 15);
	map.addControl(new OpenLayers.Control.LayerSwitcher());
	map.addControl(new OpenLayers.Control.Attribution());
}

function panToPoint(map,lng,lat) {
	   if(lng==0) return;
	   if(lat==0) return;
	   var geographic = new OpenLayers.Projection("EPSG:4326");
	   var mercator = new OpenLayers.Projection("EPSG:900913");   
	   var custom_center = new OpenLayers.LonLat(lng, lat).transform(
	     geographic, mercator
	    );
	   map.panTo(custom_center); 
	  }